cmake_minimum_required(VERSION 2.6)
PROJECT(SA2D)
SET(CMAKE_VERBOSE_MAKEFILE on)
SET(CMAKE_CXX_COMPILER gcc)
SET(CMAKE_C_COMPILER gcc)
SET(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
SET(CMAKE_USE_RELATIVE_PATHS on)

SET (CMAKE_BUILD_TYPE Release)

SET(CMAKE_C_FLAGS_DEBUG "-Wall -g")
SET(CMAKE_C_FLAGS_RELEASE "-O3 -ffast-math -Wall ")
SET(CMAKE_CXX_FLAGS_DEBUG "-Wall -g")
SET(CMAKE_CXX_FLAGS_RELEASE "-O3 -ffast-math -Wall -x c++")

SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ../lib/sa2d)
SET(CurrentStatic sa2d)

LINK_DIRECTORIES(../lib/chipmunk ../lib/tracker ../lib/CGAL ../lib/tinyxml ../lib/dom)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/include/tinyxml)

SET(Libraries
 sadom
 chipmunk
 m
 glut
 pthread
 )
SET(Headers
 util.h
 arena.h
 actor.h
 draw.h
sa2d.h
)
SET(Sources
 arena.c
 actor.c
 draw.c
sa2d.cpp
)

set_source_files_properties(${Sources} PROPERTIES LANGUAGE CXX)
set_source_files_properties(${Headers} PROPERTIES LANGUAGE CXX)

ADD_LIBRARY(${CurrentStatic} STATIC
 ${Headers}
 ${Sources}
)


